package com.wlz;


/**
 * 实现Runnable接口，重写run方法，实现Runnable接口的实现类的实例对象作为Thread构造函数的target
 * @author wlz
 */
public class ThreadRunnable implements Runnable {
    private String name;

    public ThreadRunnable(String name) {
        this.name = name;
    }

    @Override
    public void run() {
        System.out.println(name + "好");
    }

    public static void main(String[] args) {
        new Thread(new ThreadRunnable("老师")).start();


    }

}
